<extend name="Public/List/Common"/>

<block name="pageHeader">
    <div class="bjui-pageHeader">
        <a href="{:U('addhook')}" class="btn btn-green" data-toggle="dialog" data-width="600" data-height="200"
           data-id="dialog-normal" data-mask="true" data-title="{$arr.title}-编辑">添加</a>
    </div>
</block>

<block name="pageContent">
    <div class="bjui-pageContent tableContent">
        <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr>
                <th data-order-field="id">名称</th>
                <th>标识</th>
                <th>描述</th>
                <th>状态</th>
                <th>作者</th>
                <th>版本</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if(@$list)foreach($list as $arr):?>
            <tr data-id="{$arr.id}">
                <td>{$arr.title}</td>
                <td>{$arr.name}</td>
                <td>{$arr.description}</td>
                <td>{$arr.status_text|default="未安装"}</td>
                <td><a target="_blank" href="{$arr.url|default='http://www.onethink.cn'}">{$arr.author}</a></td>
                <td>{$arr.version}</td>
                <td>
                    <empty name="arr.uninstall">
                        <?php
								$class	= get_addon_class($arr['name']);
								if(!class_exists($class)){
									$has_config = 0;
								}else{
									$addon = new $class();
									$has_config = count($addon->getConfig());
                                }
                        ?>
                        <?php if ($arr['has_adminlist']==1): ?>
                        <a href="{:U('adminList',array('name'=>$arr['name']))}"  class="btn btn-green" data-id="addons{$arr.id}adminList" data-toggle="navtab" data-title="{$arr.title}-插件后台">插件后台</a>
                        <?php endif ?>
                        <?php if ($has_config): ?>
                        <a href="{:U('config',array('id'=>$arr['id']))}" class="btn btn-green" data-id="addons{$arr.id}config" data-toggle="navtab" data-title="{$arr.name}-设置">设置</a>
                        <?php endif ?>
                        <?php if ($arr['status'] >=0): ?>
                        <eq name="arr.status" value="0">
                            <a href="{:U('enable',array('id'=>$arr['id']))}" class="btn btn-green" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？" data-type="GET">启用</a>
                            <else />
                            <a href="{:U('disable',array('id'=>$arr['id']))}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？" data-type="GET">禁用</a>
                        </eq>
                        <?php endif ?>
                        {// <eq name="vo.author" value="thinkphp">}
                        <a href="{:U('uninstall?id='.$arr['id'])}" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要卸载插件？" data-type="GET">卸载</a>
                        {// </eq>}
                        <else />
                        <a href="{:U('install?addon_name='.$arr['name'])}" class="btn btn-blue" data-toggle="doajax" data-confirm-msg="确定要安装插件？" data-type="GET">安装</a>
                    </empty>
                </td>
            </tr>
            <?php endforeach;?>
            </tbody>
        </table>
    </div>
</block>

<block name="pageFooter"></block>